{% extends "main/base.html" %}
{% load i18n static main_tag %}
{% block title %}{% trans '订单列表' %}{% endblock %}
{% block this_css %}
<link rel="stylesheet" type="text/css" href="{% static 'flatlab/css/bootstrap-select.min.css' %}">
{% endblock %}
{% block content %}
<section class="panel">
    {% if perms.main.add_equipmentlist %}
    <div class="panel-body">
        <div class="col-md-12" align="right">
            <a href="{% url 'main:create_batch_equipment_list' %}?next={{ request.path }}"><button type="button" class="btn btn-success">{% trans "创建列表" %}</button></a>
        </div>
    </div>
    {% endif %}
    {% get_current_language as LANGUAGE_CODE %}
    <div class="table-responsive panel-body">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>{% trans '名称' %}</th>
                    <th>{% trans '设备列表' %}</th>
                    <th>{% trans '创建时间' %}</th>
                    <th>{% trans '最后更新' %}</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>{% for d in page_obj %}
                <tr>
                    <td>{{ d.pk }}</td>
                    <td><a href="">{{ d.title }}</a></td>
                    <td>{% for e in d.get_equipment_list %}[{{ e.index }}] {{ e.equipment }}&nbsp;{{ e.amount }}<br>{% endfor %}</td>
                    <td>{{ d.datetime_created }}</td>
                    <td>{{ d.datetime_updated }}</td>
                    <td align="right">
                        {% if perms.main.change_equipmentlist %}
                        <a href="{% url 'main:equipment_list_update' d.pk %}"><button class="btn btn-warning btn-xs"><i class="fa fa-pencil"></i></button></a>
                        {% endif %}
                    </td>
                </tr>{% endfor %}
            </tbody>
        </table>
        <div align="right">
            {% include 'main/tablenav.html' %}
        </div>
    </div>
</section>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-select.min.js' %}"></script>
{% endblock %}